package com.xmutca.sso.manager;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.rpc.protocol.rest.RpcExceptionMapper;
import com.xmutca.core.common.Results;
import com.xmutca.sso.api.Account;
import com.xmutca.sso.api.manager.service.AccountService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author: 彭伟煌(pengweihuang@xmutca.com)
 * @create: 2016-08-23 22:25
 */
@Controller
@RequestMapping("/accounts")
public class AccountController {

    @Reference(version = "1.0.0", group = "sso", validation = "true")
    private AccountService accountService;

    @ResponseBody
    @RequestMapping(method = RequestMethod.GET)
    public Object query(@RequestParam(required = false, defaultValue = "1") int current, @RequestParam(required = false, defaultValue = "10") int pageSize, @RequestParam Map<String, Object> paramMap) {
        return accountService.query(current, pageSize, paramMap);
    }
}
